<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>cool.js</title>
<style>
    html,body{
        padding: 0 0 0 0;
        margin: 0 0 0 0;
    }
</style>
    <script src="../dist/cool.js"></script>

</head>
<body  oncontextmenu=self.event.returnValue=false>
    <canvas id="webgl" width="600" height="600">
        Please use a browser that supports "canvas"
    </canvas>
    <div id="param">

    </div>
</body>

<script>

    var material = new COOL.MeshLambertMaterial({color:[1,1,0,1]});
    var materialPlane = new COOL.MeshLambertMaterial({color:[1,1,1,1]});

    var plane = new COOL.Mesh({material:materialPlane});
    plane.setPosition([0,-3,0]);
    plane.setScale([20,1,15]);

    var scene = new COOL.Scene();
//    scene.add(plane);

    var ambientLight = new COOL.AmbientLight({intensity: 1.0});
    scene.add(ambientLight);

    var directionalLight = new COOL.DirectionalLight({intensity: 1.0, direction: [0.5,0.8,0.2]});
    scene.add(directionalLight);

    var camera = new COOL.Camera(45,1,1,1000);
    camera.setPosition([-8, 0, 8 ]);

    var cameraController = new COOL.CameraController(camera);
    cameraController.update();

    var renderer = new COOL.Renderer({

    });


    var loader1 = new COOL.GLTFLoader2();
    loader1.load( "./models/gltf/DamagedHelmet/DamagedHelmet.gltf", function( gltf ) {
//       gltf.setPosition([2,0,0]);
        for(var i in gltf.children){
            scene.add(gltf.children[i]);
        }

    } );


    function renderLoop() {
       renderer.render(scene,camera);
       requestAnimationFrame(function () {
           renderLoop();
       });
    }

    renderLoop();

</script>
</html>
